function login() {
    //用户名'
    var submitFlg = true;
    var user = {register: /^[\w\u4e00-\u9fa5]{1,6}$/, tip: '请输入1-6位的英文、数字、中文、下划线'};
    var username = document.getElementById("userName").value;
    var spans = document.getElementById("userName").parentNode.getElementsByTagName("span");
    spans[0].innerHTML = "";
    if (!user.register.test(username)) {
        spans[0].innerHTML = user.tip;
        submitFlg = false;
    }
//    密码
    var pass = {register: /^[\w]{6,12}$/, tip: '请输入6-12位的英文、数字、下划线@#*'};
    var passWord = document.getElementById("passWord").value;
    var remark = document.getElementById("passWord").parentNode.getElementsByTagName("span");
    remark[0].innerHTML = "";
    if (!user.register.test(passWord)) {
        remark[0].innerHTML = pass.tip;
        submitFlg = false;
    }
//验证密码
    var newPass = document.getElementById("newpassWord").value;
    var oldPsaa = document.getElementById("passWord").value;
    var newp = document.getElementById("new");
    if (newPass!=oldPsaa){
        newp.innerHTML="两次密码不一致";
    }else{
        newp.innerHTML="密码一致";
    }
//    验证手机号
    var phone = {register: /^[1][3,4,5,7,8][0-9]{9}$/, tip: '请输入正确的手机号'};
    var confirm_p = document.getElementById("phone").value;
    var remark_phone = document.getElementById("phone").parentNode.getElementsByTagName("span");
    remark_phone[0].innerHTML = "";
    if (!phone.register.test(confirm_p)) {
        remark_phone[0].innerHTML = phone.tip;
        submitFlg = false;
    }
    return submitFlg;
}